package com.lanvideo.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 学习记录实体类
 */
public class LearningRecord {
    private Integer id;
    private Integer userId;
    private Integer videoId;
    private LocalDateTime startTime;
    private LocalDateTime completionTime;
    private Integer totalDuration; // 总学习时长（秒）
    private Integer lastPosition; // 最后观看位置（秒）
    private Boolean completed; // 是否完成学习
    
    // 关联信息
    private String videoTitle;
    private String userName;

    public LearningRecord() {}

    public LearningRecord(Integer userId, Integer videoId) {
        this.userId = userId;
        this.videoId = videoId;
        this.lastPosition = 0;
        this.completed = false;
    }

    // Getters and Setters
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getVideoId() {
        return videoId;
    }

    public void setVideoId(Integer videoId) {
        this.videoId = videoId;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getCompletionTime() {
        return completionTime;
    }

    public void setCompletionTime(LocalDateTime completionTime) {
        this.completionTime = completionTime;
    }

    public Integer getTotalDuration() {
        return totalDuration;
    }

    public void setTotalDuration(Integer totalDuration) {
        this.totalDuration = totalDuration;
    }


    public Integer getLastPosition() {
        return lastPosition;
    }

    public void setLastPosition(Integer lastPosition) {
        this.lastPosition = lastPosition;
    }

    public Boolean getCompleted() {
        return completed;
    }

    public void setCompleted(Boolean completed) {
        this.completed = completed;
    }

    public String getVideoTitle() {
        return videoTitle;
    }

    public void setVideoTitle(String videoTitle) {
        this.videoTitle = videoTitle;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Override
    public String toString() {
        return "LearningRecord{" +
                "id=" + id +
                ", userId=" + userId +
                ", videoId=" + videoId +
                ", startTime=" + startTime +
                ", completionTime=" + completionTime +
                ", totalDuration=" + totalDuration +
                ", lastPosition=" + lastPosition +
                ", completed=" + completed +
                ", videoTitle='" + videoTitle + '\'' +
                ", userName='" + userName + '\'' +
                '}';
    }
}
